home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / exitwi4r / module1.bas < prev    next >
BASIC Source File  |  1999-07-12  |  3KB  |  91 lines

  1. Attribute VB_Name = "Module1"
  2. Dim linex1 As Variant
  3. Dim liney1 As Variant
  4. Dim liney2 As Variant
  5. Dim linex2 As Variant
  6. Dim circlex As Variant
  7. Dim circley As Variant
  8. Dim circler As Variant
  9. Dim colour As Long
  10. Function getcommand(searchin As String) As String
  11. Dim n As Integer, s As String
  12. 'Here it search on the text for a space then it gets its position on the text
  13. n = InStr(1, searchin, " ", vbTextCompare)
  14. 'it gets the string from th start position (1) to the end position (n)
  15. s = Mid(searchin, 1, n - 1)
  16. 'for reading any command on any state i format it to set all the letters on capital state
  17. s = Format(s, ">")
  18. 'it return the string to the function
  19. getcommand = s
  20. End Function
  21.  
  22. Function getval(searchin As String) As String
  23. Dim n As Integer, s As String
  24. 'Here it search on the text for a space then it gets its position on the text
  25. n = InStr(1, searchin, " ", vbTextCompare)
  26. 'it gets the number of charchters on the text
  27. x = Len(searchin)
  28. 'it gets the string from th start position (n) to the end of the text
  29. s = Mid(searchin, n + 1, x - 1)
  30. 'it return the string to the function
  31. getval = s
  32. End Function
  33.  
  34. Sub docommand(cmnd As String, cval As String)
  35. On Error Resume Next
  36. 'Her the programe find the command and excute it
  37. 'it select the value of cmnd and then excute it
  38. Select Case cmnd
  39. 'Here it selcet the case (print) that = to cmnd value
  40. Case "PRINT":
  41. 'Print the command value (cval) to form2
  42. Form2.Print cval
  43. Case "DEBUG.PRINT":
  44. MDIForm1.Picture2.Print cval
  45. Case "LINEX1":
  46. linex1 = cval
  47. Case "LINEY1":
  48. liney1 = cval
  49. Case "LINEX2":
  50. linex2 = cval
  51. Case "LINEY2":
  52. liney2 = cval
  53. Case "DOLINE":
  54. Form2.Line (linex1, liney1)-(linex2, liney2)
  55. Case "CLS":
  56. Form2.Cls
  57. Case "PRINTFORM":
  58. Form2.PrintForm
  59. Case "CIRCLEX":
  60. circlex = cval
  61. Case "CIRCLEY":
  62. circley = cval
  63. Case "CIRCLERADIUS":
  64. circler = cval
  65. Case "CIRCLECOLOR":
  66. If cval = "RED" Then colour = vbRed
  67. If cval = "GREEN" Then colour = vbGreen
  68. If cval = "WHITE" Then colour = vbWhite
  69. If cval = "BLACK" Then colour = vbBlack
  70. If cval = "YELLOW" Then colour = vbYellow
  71. colour = cval
  72. Case "DOCIRCLE":
  73. Form2.Circle (circlex, circley), circler, colour
  74. Case "SCREEN.CAPTION":
  75. Form2.Caption = cval
  76. Case "SCREEN.PICTURE":
  77. Form2.Picture = LoadPicture(cval)
  78. Case "SCREEN.FORECOLOR":
  79. If cval = "RED" Then colour = vbRed
  80. If cval = "GREEN" Then colour = vbGreen
  81. If cval = "WHITE" Then colour = vbWhite
  82. If cval = "BLACK" Then colour = vbBlack
  83. If cval = "YELLOW" Then colour = vbYellow
  84. Form2.ForeColor = colour
  85. Case "SCREEN.FONTNAME":
  86. Form2.FontName = cval
  87. Case "SCREEN.FONTSIZE":
  88. Form2.FontSize = cval
  89. End Select
  90. End Sub
  91.